package org.compression.run;

import java.util.HashSet;

import org.compression.constant.Constant;
import org.compression.mapper.AccessIPStatMapper;
import org.model.auth.AccessIPStat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class InitProject implements ApplicationRunner {
    private static final Logger LOG = LoggerFactory.getLogger(InitProject.class);
    
    @Autowired
    AccessIPStatMapper mAccessIPStatMapper;
    
    @Override
    public void run(ApplicationArguments args) throws Exception {
    HashSet<AccessIPStat>	mips= mAccessIPStatMapper.getIps();
    	for(AccessIPStat ip:mips) {
    		Constant.ips.add(ip.getIpAddr());
    	}
    
    	
    }
    
    
    
} 